//
//  SetHeaderCell.m
//  witMorning
//
//  Created by 信晨汇 on 2018/1/5.
//  Copyright © 2018年 zt. All rights reserved.
//

#import "SetHeaderCell.h"
#import "UIColor+Hex.h"
#import "UIView+Extension.h"
@implementation SetHeaderCell



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        
        UIView *cusView = [[UIView alloc]initWithFrame:CGRectMake(0, 5, SCREEN_W, 90)];
        cusView.backgroundColor = [UIColor colorWithHexString:@"#f5f5f5"];
        cusView.layer.shadowOffset = CGSizeMake(5, 2);
        cusView.layer.shadowColor = [UIColor grayColor].CGColor;
        cusView.layer.shadowOpacity = 0.5;//阴影透明度，默认0
        cusView.layer.shadowRadius = 2;//阴影半径，默认3
        [self.contentView addSubview:cusView];
        
        
        UIView *iconView = [[UIView alloc]initWithFrame:CGRectMake(20, 10, 70, 70)];
        iconView.backgroundColor = [UIColor colorWithHexString:@"#43aef2"];
        iconView.layer.cornerRadius = 5;
        iconView.clipsToBounds = YES;
        [cusView addSubview:iconView];
        
        
        _iconImage = [[UIImageView alloc]initWithFrame:CGRectMake(15, 15, 40, 40)];
//        _iconImage.backgroundColor = [UIColor orangeColor];
//        _iconImage.layer.cornerRadius = 5;
//        _iconImage.clipsToBounds = YES;
        _iconImage.image = [UIImage imageNamed:@"userImage"];
        [iconView addSubview:self.iconImage];
        
        
        _nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(iconView.right + 10, iconView.y+10, 200, 20)];
        _nameLabel.text = USERDEF_GET_VALUE(@"username")?USERDEF_GET_VALUE(@"username") :@"未登录";
        _nameLabel.font = [UIFont systemFontOfSize:14];
        [cusView addSubview:self.nameLabel];
        
        
        _idLabel = [[UILabel alloc]initWithFrame:CGRectMake(100, _nameLabel.bottom+10, 200, 20)];
        _idLabel.text = USERDEF_GET_VALUE(@"account")?USERDEF_GET_VALUE(@"account") :@"未登录";
        _idLabel.font = [UIFont systemFontOfSize:14];
        [cusView addSubview:self.idLabel];
        
      
        
        
    }
    
    
    return self;
    
}

@end
